//-----------------------------------------------------------------------------
//  Copyright (C) 2005-2008 Thomas S. Ullrich 
//
//  This file is part of the Solitaire Mahjong project.
//
//  This file may be used under the terms of the GNU General Public License.
//  This project is free software; you can redistribute it and/or modify it
//  under the terms of the GNU General Public License.
//  
//  Author: Thomas S. Ullrich
//  Last update: November 14, 2008
//-----------------------------------------------------------------------------
#ifndef smPlayedTilesList_h
#define smPlayedTilesList_h

#include <QPixmap> 
#include <vector>
#include <stack>
#include "ui_smPlayedTilesList.h"

class smTileItem;

using namespace std;
  
class smPlayedTilesList : public QDialog
{
    Q_OBJECT
    

public:
    smPlayedTilesList(QWidget* parent = 0, Qt::WindowFlags fl = 0);
    ~smPlayedTilesList();
 
    void sync(stack<pair<smTileItem*, smTileItem*> >);
 
protected:
    void showEvent(QShowEvent*);
    void hideEvent(QHideEvent*);

private slots:
    void sortingModeHasChanged();

private:
    void layoutList();
    vector<vector<smTileItem*> > getSortedList(const vector<pair<smTileItem*, smTileItem*> > &); 

private:
    Ui::smPlayedTilesList      ui;
    vector<pair<smTileItem*, smTileItem*> > mHistoryList;
    bool mSortAsPlayed;
};
#endif
